I can envision the existence of much better solutions, but I am happy with this one, and I'm not going to even try to improve it further.